Fix bugs in update-game-score, on MS-Windows and elsewhere.
authorEli Zaretskii <eliz@gnu.org>
Mon, 5 Aug 2013 17:09:28 +0000 (20:09 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 5 Aug 2013 17:09:28 +0000 (20:09 +0300)
commit40dd00dd6049407ee72f380a523caf09ecdb4e77
tree0dc3b0377d9722a0eb0f5d79f86a029799e3e6db
parent68ee1ee2b90791f978f0eea72c623aba4b9b19c4
Fix bugs in update-game-score, on MS-Windows and elsewhere.

 lib-src/update-game-score.c (read_score): Try reading a character before
 probing the stream for EOF.  Initialize score->score to zero,
 before reading and accumulating the score.
 (read_scores): Fix logic that determines which value to return.
 Close the input stream when finished reading the scores (avoids
 failures in overwriting the file with a new one on MS-Windows,
 since a file that is open cannot be deleted).
 lib-src/ntlib.h (rename): Don't undefine.
 lib-src/ntlib.c (sys_rename): New function, needed for
 update-game-score.
lib-src/ChangeLog
lib-src/ntlib.c
lib-src/ntlib.h
lib-src/update-game-score.c